Skip to main content

05 - Accelerometer

Overview


The accelerometer sensor can provide numerical feedback on the acceleration of the three axes. When the development board is stationary relative to the earth, the vector acceleration under this condition is the acceleration of gravity of the earth. 资源 9.png

How to Use


Blocks Introduction

Programming BlocksFunctional Introduction
image-20240321150618089Returns acceleration values in X, Y, and Z axes, with a range of -2~2 (in g unit)
image-20240321150625140Returns simple attitude angles
- Pitch: range -90~90
- Roll: range -90~90
image-20240321150633123Attitude detection, if the current Grapeboard is in the specified state, the block returns true after execution

Case 1: Race Walk Foul Detection

  • Effect: The Grove board will emit an alert when the athlete's movements are too large.

image.png

  • Programming Blocks

    image-20240321150758776

Case 2 - Sitting Posture Detection

  • Effect: Place the micro:bit on your head, if your sitting posture is incorrect, it will sound a reminder~ image.png

  • Program blocks

    image-20240321150849807

Case3 - Keep balance

  • Effect: Keep the LED light to maintain the brightness

  • Program block diagram

    image-20240321151105075